import request from '@/utils/request'

export default {
  getChapterAndSectionList(courseId) {
    return request({
      url: `/admin/courses/getChapterAndSection/${courseId}`, method: 'get'
    })
  },
  getChapter(chapterId) {
    return request({
      url: `/admin/courses/getChapter/${chapterId}`,
      method: 'get'
    })
  },
  updateChapter(chapter) {
    return request({
      url: `/admin/courses/updateChapter`,
      method: 'put',
      data: chapter
    })
  },
  delChapter(id) {
    return request({
      url: `/admin/courses/delChapter/${id}`,
      method: 'delete'
    })
  },
  addChapter(chapter) {
    return request({
      url: `/admin/courses/addChapter`,
      method: 'post',
      data: chapter
    })
  },
}
